package cache

import (
	"github.com/go-redis/redis/v7"
)

func IsRedisNil(err error) bool {
	return err == redis.Nil
}

func MapStringToMapInterface(v map[string]string) map[string]interface{} {
	if v == nil {
		return nil
	}
	m := make(map[string]interface{})
	for key, value := range v {
		m[key] = value
	}
	return m
}

func MapStringToMapRedisString(v map[string]string) map[string]RedisString {
	if v == nil {
		return nil
	}
	m := make(map[string]RedisString)
	for key, value := range v {
		m[key] = RedisString(value)
	}
	return m
}
